//
//  MessageSetVC.swift
//  Employee
//
//  Created by swordjoy on 2017/3/30.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import UIKit

class MessageSetVC: BaseVC {
  
  var model: ChatUser!
  
  fileprivate var chatUserInfoV: MessageSetV!
  fileprivate var deleteRecordButton: UIButton!
  
  override func viewDidLoad() {
    super.viewDidLoad()
    
    view.backgroundColor = GlobalConfig.BGWhiteColor
    title = "聊天设置"
    
    create()
    
  }
  
  override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    
    GlobalConfig.baiduStatisticsPageViewStart("聊天设置")
  }
  
  override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    
    GlobalConfig.baiduStatisticsPageViewEnd("聊天设置")
  }

}

// MARK: - action

extension MessageSetVC {
  
  @objc fileprivate func deleteRecordAction() {
    
  }
  
  @objc fileprivate func tapAction() {
   
    
  }
  
}

// MARK: - fileprivate

extension MessageSetVC {
  
  fileprivate func create() {
    
    addBackItem()
    
    chatUserInfoV = MessageSetV(frame: CGRect(x: 0, y: 0, width: UIScreen.width, height: 88))
    chatUserInfoV.model = model
    view.addSubview(chatUserInfoV)
    
    let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapAction))
    chatUserInfoV.addGestureRecognizer(tapGesture)
    
    deleteRecordButton = UIButton()
    view.addSubview(deleteRecordButton)
    deleteRecordButton.setTitle("清空聊天记录", for: .normal)
    deleteRecordButton.backgroundColor = UIColor.white
    deleteRecordButton.setTitleColor(GlobalConfig.GrapeFruitColor, for: .normal)
    deleteRecordButton.titleLabel?.font = GlobalConfig.system16Font
    deleteRecordButton.addTarget(self, action: #selector(deleteRecordAction), for: .touchUpInside)
    deleteRecordButton.snp.makeConstraints { (make) in
      make.left.equalTo(10)
      make.right.equalTo(-10)
      make.bottom.equalTo(-10)
      make.height.equalTo(50)
    }
    
  }
  
}
